import streamlit as st
import pandas as pd

df = pd.DataFrame({
    'Name': ["Bob", "Lex", "David"],
    'age': [23, 45, 67],
    "salary": [1000, 2000, 3000]
})
st.dataframe(df)
df_editable = st.data_editor(df)
print(df_editable)
st.table(df_editable)

st.metric(label="total number of rows",value=len(df_editable))
st.write(f"📏 数据维度: {len(df_editable)} 行 × {len(df_editable.columns)} 列")
st.write(f"Average year:", df_editable["age"].mean())

st.json(df_editable.to_json())
